<!DOCTYPE html>
<html lang="en">

<!--
  Author：蓝田_Loto
  Date：2018-10-18 18:02
  PageName：i_imagebg_Size.html
  Function：设置背景图像 - 图像大小
  URL：http://localhost:8080/f_image/f3_image_background/i_imagebg_Size.html
-->

<head>
    <meta charset="UTF-8">
    <title>设置背景图像 - 图像大小</title>

    <style type="text/css">
        div {
            margin: 2px;
            float: left;
            border: solid 1px red;
            background: url(images/TD.jpg) no-repeat center;
            -moz-background-size: cover;
            -webkit-background-size: cover;
            background-size: cover;  /*设计背景图像完全覆盖元素区域*/
        }

        /* 设计元素大小 */
        .h1 {
            height: 120px;
            width: 192px;
        }

        .h2 {
            height: 240px;
            width: 384px;
        }
    </style>
</head>

<body>
<div class="h1"></div>
<div class="h2"></div>
</body>
</html>